package com.hskn.hss.module.cases.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author hskn
 * @since 2021-05-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class CasesCharts implements Serializable {
    private String createTime;
    /**
     * 应处理事件
     */
    @TableField(exist = false)
    private String allCount;
    /**
     * 实际处理事件
     */
    @TableField(exist = false)
    private String overCount;
    /**
     * 未处理事件
     */
    @TableField(exist = false)
    private String noOverCount;
    /**
     * 及时处理事件
     */
    @TableField(exist = false)
    private String timelyCount;
    /**
     * 逾期处理
     */
    @TableField(exist = false)
    private String outTimeCount;

    /**
     * 及时处理率
     */
    @TableField(exist = false)
    private String timelyCountRate;
    /**
     * 逾期处理率
     */
    @TableField(exist = false)
    private String outTimeRate;
    @TableField(exist = false)
    private List <String> resList;
    public String getTimelyCountRate() {
        return timelyCountRate;
    }

    public String getOutTimeRate() {
        return outTimeRate;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getAllCount() {
        return allCount;
    }

    public void setAllCount(String allCount) {
        this.allCount = allCount;
    }

    public String getOverCount() {
        return overCount;
    }

    public void setOverCount(String overCount) {
        this.overCount = overCount;
    }

    public String getTimelyCount() {
        return timelyCount;
    }

    public void setTimelyCount(String timelyCount) {
        this.timelyCount = timelyCount;
    }

    public String getOutTimeCount() {
        return outTimeCount;
    }

    public void setOutTimeCount(String outTimeCount) {
        this.outTimeCount = outTimeCount;
    }

    public void setTimelyCountRate(String timelyCountRate) {
        this.timelyCountRate = timelyCountRate;
    }

    public void setOutTimeRate(String outTimeRate) {
        this.outTimeRate = outTimeRate;
    }

    public void setResList(List<String> resList) {
        this.resList = resList;
    }

    public String getNoOverCount() {
        return String.valueOf(Integer.valueOf(allCount)-Integer.valueOf(overCount));
    }

    public List<String> getResList(String f) {
        resList=new ArrayList<>();
        if (f.equals("2")) {
            if (StringUtils.isNotBlank(allCount)){
                resList.add(allCount);
            }else {
                resList.add("0");
            }
            if (StringUtils.isNotBlank(overCount)){
                resList.add(overCount);
            }else {
                resList.add("0");
            }
            if (StringUtils.isNotBlank(timelyCount)){
                resList.add(timelyCount);
            }else {
                resList.add("0");
            }
            if (StringUtils.isNotBlank(outTimeCount)){
                resList.add(outTimeCount);
            }else {
                resList.add("0");
            }
        } else {
            if (StringUtils.isNotBlank(allCount)){
                resList.add(allCount);
            }else {
                resList.add("0");
            }
            if (StringUtils.isNotBlank(overCount)){
                resList.add(overCount);
            }else {
                resList.add("0");
            }
            if (StringUtils.isNotBlank(noOverCount)){
                resList.add(noOverCount);
            }else {
                resList.add("0");
            }

        }

        return resList;
    }



}
